package com.hospital.pet.love.lovepethospital.exp;

import com.hospital.pet.love.lovepethospital.resp.ResultCodeEnum;
import lombok.Data;
import lombok.Getter;

/**
 * @author RoselleShaw
 * @create 2024-04-08 6:03
 */
@Getter
public class ShawCustomException extends RuntimeException {

    private final Integer code;
    private final String message;
    private ResultCodeEnum resultCodeEnum;

    public ShawCustomException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ShawCustomException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
        this.resultCodeEnum = resultCodeEnum;
    }

    public ShawCustomException(String message) {
        this.code = ResultCodeEnum.UNKNOWN.getCode();
        this.message = message;
    }
}
